/**
 * 
 */
package com.java.test.paymanage.dto;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * @author 收款账户
 *
 */
public class SkAccountInfo implements RowMapper<SkAccountInfo> {

	// 主键
	private int id;

	// 支付类型名
	private String payTypeName;

	// 支付类型
	private int payType;

	// 货币类型id
	private String moneyTypeId;
	
	private String moenyTypeName;

	// 渠道id
	private int channelId;
	
	// 收款渠道名称
	private String channelName;

	// 收款账号
	private String skAccount;
	
	// 收款账号名字
	private String skAccounName;

	// 使用地区
	private String areaId;

	// 区域名字
	private String areaName;

	// 绑定分层
	private String sliceName;
	
	// 分层id
	private String sliceId;
	

	// 优化比例
	private String yhproportion="0.00";

	// 添加人
	private String addPeopleName;

	// 添加时间
	private LocalDateTime addTime;

	// 状态 1：启用，0：禁用
	private int status;

	// 当前排序id
	private int sort=0;

	private String foundsTypeName;

	public String getFoundsTypeName() {
		return foundsTypeName;
	}

	public void setFoundsTypeName(String foundsTypeName) {
		this.foundsTypeName = foundsTypeName;
	}

	public String getMoneyTypeId() {
		return moneyTypeId;
	}

	public void setMoneyTypeId(String moneyTypeId) {
		this.moneyTypeId = moneyTypeId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getPayTypeName() {
		return payTypeName;
	}

	public void setPayTypeName(String payTypeName) {
		this.payTypeName = payTypeName;
	}

	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public String getSkAccount() {
		return skAccount;
	}

	public void setSkAccount(String skAccount) {
		this.skAccount = skAccount;
	}

	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	public String getAreaId() {
		return areaId;
	}

	public void setAreaId(String areaId) {
		this.areaId = areaId;
	}

	public String getSliceName() {
		return sliceName;
	}

	public void setSliceName(String sliceName) {
		this.sliceName = sliceName;
	}

	public String getYhproportion() {
		return yhproportion;
	}

	public void setYhproportion(String yhproportion) {
		this.yhproportion = yhproportion;
	}

	public String getAddPeopleName() {
		return addPeopleName;
	}

	public void setAddPeopleName(String addPeopleName) {
		this.addPeopleName = addPeopleName;
	}

	public LocalDateTime getAddTime() {
		return addTime;
	}

	public void setAddTime(LocalDateTime addTime) {
		this.addTime = addTime;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	public int getPayType() {
		return payType;
	}

	public void setPayType(int payType) {
		this.payType = payType;
	}
	
	

	public String getMoenyTypeName() {
		return moenyTypeName;
	}

	public void setMoenyTypeName(String moenyTypeName) {
		this.moenyTypeName = moenyTypeName;
	}

	public String getSkAccounName() {
		return skAccounName;
	}

	public void setSkAccounName(String skAccounName) {
		this.skAccounName = skAccounName;
	}

	public String getSliceId() {
		return sliceId;
	}

	public void setSliceId(String sliceId) {
		this.sliceId = sliceId;
	}

	


	public int getChannelId() {
		return channelId;
	}

	public void setChannelId(int channelId) {
		this.channelId = channelId;
	}

	@Override
	public SkAccountInfo mapRow(ResultSet rs, int rowNum) throws SQLException {

		SkAccountInfo info = new SkAccountInfo();

		info.setId(rs.getInt("id"));

		info.setAddPeopleName(rs.getString("addpeople_name"));
		info.setAddTime(rs.getTimestamp("add_time") == null ? null
				: rs.getTimestamp("add_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());
		info.setAreaId(rs.getString("area_id"));
		info.setChannelName(rs.getString("channel_name"));
		info.setPayType(rs.getInt("pay_type"));
		info.setSkAccount(rs.getString("sk_account"));
		info.setSkAccounName(rs.getString("sk_account_name"));
		
		
		info.setSliceId(rs.getString("slice_id"));

		info.setSort(rs.getInt("sort"));
		info.setStatus(rs.getInt("status"));
		info.setYhproportion(rs.getString("yh_proportion"));

		info.setPayTypeName(rs.getString("payTypeName")==null?"":rs.getString("payTypeName"));

		info.setMoneyTypeId(rs.getString("money_type"));
		
		info.setChannelId(rs.getInt("channel_id"));

		info.setFoundsTypeName(rs.getString("foundsTypeName")==null?"":rs.getString("foundsTypeName"));
		
		return info;
	}

}
